<?php
declare (strict_types=1);

namespace app\model;

use think\Model;
use think\model\concern\SoftDelete;
use app\traits\ModelTrait;

/**
 * 用户
 * Class Order
 * @package app\model
 */
class Order extends BaseModel
{
    public static $_table = "order";

    const ORDER_STATUS_FILLING = 0;//失败订单
    const ORDER_STATUS_COMMIT = 1; //下单成功
    const ORDER_STATUS_ACTIVE_SUCCESS = 2;//激活成功
    const ORDER_STATUS_CHARGE_SUCCESS = 3;//充值成功
    const ORDER_STATUS_CHARGE_FIRST_CHARGE = 4;//首充成功

    const THIRD_ORDER_STATUS_FIRST_CHARGE = 108;//首充成功
    const THIRD_ORDER_STATUS_ACTIVE = 65;//激活成功
    const THIRD_ORDER_STATUS_CHARGED = 42;//充值成功

    use SoftDelete;
    //时间字段显示格式
    protected $dateFormat = 'Y-m-d H:i:s';
    // 开启自动写入时间戳字段
    //protected $autoWriteTimestamp = 'datetime';
    //软删除时间
    protected $deleteTime = false;
    //软删除字段的默认值
    protected $defaultSoftDelete = 0;
    //只读字段，不允许被更改
    protected $readonly = [];
    //数据输出隐藏的属性
//    protected $hidden = ['user_id'];
    protected $pk = 'id';
    // 设置当前模型对应的完整数据表名称
    protected $table = 'order';
    //据输出显示的属性
    public static $showField = ['id','promotion_id', 'status', 'type', 'user_name', 'phone', 'card_number', 'address', 'create_time'];

    use ModelTrait;
}

